#include "media/logic/MediaLogicAC.h"

MediaLogicAC::MediaLogicAC(QMap<QString, QMap<QString, QString>> &RGLRLSMAP,
                             QSqlDatabase *DB,
                             QMap<QString, QString> &QSSMAP):
                             MediaLogicBT(RGLRLSMAP, DB, QSSMAP){
    diary("init successful", Diary::Debug)
}

void MediaLogicAC::user_implantation_action(QAction *action){
    if (action->text() == "注册")
    {
        user_implantation_action(CAPBAREXTRA::UI_REGISTER);
    }
    else if (action->text() == "退出登录")
    {
        user_implantation_action(CAPBAREXTRA::FC_UNLOGIN);
    }
}


void MediaLogicAC::user_implantation_action(CAPBAREXTRA Type){
    if (!QList<QWidget *>({Login_Widget, Register_Widget, Datum_Widget}).contains(RT_sliderShow->currentWidget()))
    {
        impact_int["last-accountface-index"] = RT_sliderShow->currentIndex();
    }
    QWidget *curwin = RT_sliderShow->currentWidget();
    switch (Type) {
        case CAPBAREXTRA::UI_LOGIN:
            user_gearwheel_loginload();
            (curwin == Login_Widget) ? RT_sliderShow->setCurrentIndex(impact_int["last-accountface-index"]) : RT_sliderShow->setCurrentWidget(Login_Widget);
            break;
        case CAPBAREXTRA::UI_REGISTER:
            (curwin == Register_Widget) ? RT_sliderShow->setCurrentIndex(impact_int["last-accountface-index"]) : RT_sliderShow->setCurrentWidget(Register_Widget);
            break;
        case CAPBAREXTRA::UI_DATUMINFO:
            user_gearwheel_infoload();
            if(impact_swtc["user-accept-might"]) (curwin == Datum_Widget) ? RT_sliderShow->setCurrentIndex(impact_int["last-accountface-index"]) : RT_sliderShow->setCurrentWidget(Datum_Widget);
            break;
        case CAPBAREXTRA::FC_UNLOGIN:
            user_account_quit(false);
            break;
    }
}


void MediaLogicAC::user_gearwheel_loginload(){
    QMap<QString, QList<QString>> userdatum_info = definfc.SuperQuery(DATABASE, "user_datum");
    user_template(userdatum_info, UserDataCore);
    QTimer::singleShot(20, this, [this]()
    {
        if (UserDataCore.USER_HEAD.isEmpty())
        {
            Login_head->doconfigur_pixmap(":/PIXMAP/bench/captionbar-head.png");
            diary("head losing, be use default", Diary::Debug)
        }
        else
        {
            Login_head->doconfigur_pixmap(QString("'%1'").arg(UserDataCore.USER_HEAD));
            diary("head is exists, apply now", Diary::Debug)
        }
    });qDebug() << UserDataCore.USER_RELOGINS << UserDataCore.USER_RELOGIN;
    if (UserDataCore.USER_RELOGIN)
    {
        Login_idLibox->g_linedit()->setText(UserDataCore.USER_ID);
        Login_keyLine->setText(UserDataCore.USER_KEY);
        Login_autoLogincBox->setChecked(true);
        QTimer::singleShot(200, this, [this](){user_gearwheel_loginsunmit();});
    }
    else if (UserDataCore.USER_RECALL)
    {
        Login_keyLine->setText(UserDataCore.USER_KEY);
    }
    else
    {
        if (Login_idLibox->g_linedit()->text().isEmpty())
        {
            Login_idLibox->g_linedit()->setFocus();
        }
        else if (Login_keyLine->text().isEmpty())
        {
            Login_keyLine->setFocus();
        }
    }
}


void MediaLogicAC::user_gearwheel_headadd(){
    MessageBoxQ *imageBox ;
    impact_str["acadd-temporary-head"] = QFileDialog::getOpenFileName(this,
                                                                      "add pixmap",
                                                                      impact_str["mdacc-follow-directory"],
                                                                      QString("image File (*.%1)").arg(impact_ststr["fm-image"].join(" *.")));
    imageBox = new MessageBoxQ(this,
                               {"using the image", "ignore"},
                               MessageBoxQ::MSG_Question,
                               "Add File",
                               QString("File Verify:\n%1").arg(impact_str["acadd-temporary-head"]));
    connect(imageBox, &MessageBoxQ::checkEvent, this, [&](QPushButton *button)
    {
        if (button->text() == "using the image")
        {
            Datum_historyBox->g_stall()->addItem(impact_str["acadd-temporary-head"]);
            Datum_historyBox->g_linedit()->setText(impact_str["acadd-temporary-head"]);
            if (impact_str["mdrs-follow-directory"] == "follow")
            {
                impact_str["mdrs-follow-directory"] = impact_ststr["mdrs-local-folders"].last();
            }
            USER_DLLD_QTIER.start();
            diary(QString("apply image %1, historyheaders count: %2").arg(impact_str["acadd-temporary-head"],
                                                                          impact_ststr["user-temporary-heads"].count()),
                                                                          Diary::Debug)
        }
    });
}


void MediaLogicAC::user_gearwheel_headgive(QString head){
    if (!head.isEmpty())
    {
        impact_str["acadd-temporary-head"] = head;
        if (UserDataCore.USER_HEAD_PS.contains(head))
        {
            int indexof = UserDataCore.USER_HEAD_PS.indexOf(head);
            QString headrc = UserDataCore.USER_HEAD_RCS[indexof];
            QRect coord = user_gearwheel_coordpaser(headrc).toRect();
            Datum_head->setCoord(coord);
        }
        USER_DLLD_QTIER.start();
    }
}


void MediaLogicAC::user_gearwheel_loginsunmit(){
    QMap<QString, QList<QString>> userdatum_info = definfc.SuperQuery(DATABASE, "user_datum");
    QMap<QString, QList<QString>> userfavora_info = definfc.SuperQuery(DATABASE, "user_favora_datum");
    user_template(userdatum_info, UserDataCore);
    user_template(userfavora_info, UserDataCore, {"ac_id"});
    if(!impact_swtc["user-accept-might"])
    {
        if (UserDataCore.USER_IDS.contains(UserDataCore.IP_LOGIN_NAME))
        {
            if (UserDataCore.USER_KEYS.contains(UserDataCore.IP_LOGIN_KEY))
            {
                Login_sumbit->setText("be logging in");
                bool rmbKeycheck = Login_fillkeycBox->isChecked();
                bool autoLogincheck = Login_autoLogincBox->isChecked();
                QString LoginSql = QString("UPDATE user_datum SET "
                                   "recall = %1,"
                                   "relogin = %2,"
                                   "final = True,"
                                   "might = True "
                                   "WHERE ac_id = '%3'").arg(
                                   QString().number(rmbKeycheck),
                                   QString().number(autoLogincheck),
                                   UserDataCore.IP_LOGIN_NAME);
                if (Query->exec(LoginSql))
                {
                    impact_swtc["user-accept-might"] = true;
                    if (UserDataCore.USER_HEAD.isEmpty())
                    {
                        captionBar()->d_captionico(":/PIXMAP/bench/captionbar-head.png");
                    }
                    else
                    {
                        captionBar()->d_captionico(QString("'%1'").arg(UserDataCore.USER_HEAD));

                    }
                    if (!impact_str["user-temporary-alias"].isEmpty())
                    {
                        captionBar()->d_caption(impact_str["user-temporary-alias"]);
                    }
                    else if (!impact_str["user-temporary-name"].isEmpty())
                    {
                        captionBar()->d_caption(impact_str["user-temporary-name"]);
                    }
                    else
                    {
                        QString bestname;
                        int indexof = UserDataCore.USER_IDS.indexOf(UserDataCore.IP_LOGIN_NAME);
                        if (UserDataCore.USER_NAMES.size() >= indexof + 1)
                        {
                            bestname = UserDataCore.USER_NAMES[indexof];
                        }
                        else
                        {
                            bestname = UserDataCore.USER_IDS[indexof];
                        }
                        captionBar()->d_caption(bestname);
                    }
                    QString finalset_sqlchar = QString("UPDATE user_datum SET final=False WHERE ac_id!='%1';").arg(UserDataCore.IP_LOGIN_NAME);
                    if (Query->exec(finalset_sqlchar))
                    {
                        if (!UserDataCore.USER_FAVOR_NS.isEmpty())
                        {
                            Favora_ListWidget->clear();
                            add_slist->clear();
                            for(int fvr=0; fvr < UserDataCore.USER_FAVOR_NS.size(); fvr++)
                            {
                                emit sg_favoradata_load(UserDataCore.USER_FAVOR_NS[fvr], true, UserDataCore.USER_FAVOR_PS[fvr]);
                                add_slist->addAction(new QAction(QIcon(":/PIXMAP/bench/private_dvd.png"), UserDataCore.USER_FAVOR_NS[fvr]));
                            }
                        }
                        diary("final stat update success", Diary::Debug)
                    } else diary("final stat update error: " + Query->lastError().text(), Diary::Error)
                }
                QTimer::singleShot(500, this, [this](){Login_sumbit->setText("seccess");});
                impact_str["ac-accept-name"] = UserDataCore.IP_LOGIN_NAME;
                QTimer::singleShot(600, this, [this](){Login_sumbit->setText("login");
                                                       user_implantation_action(CAPBAREXTRA::UI_LOGIN);});
            }
            else
            {
                if (UserDataCore.IP_LOGIN_NAME.isEmpty())
                {
                    new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户登录", "密码不能为空");
                }
                else
                {
                    new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户登录", "密码错误");
                }
            }
        }

        else
        {
            if (UserDataCore.IP_LOGIN_NAME.isEmpty())
            {
                new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户登录", "用户名不能为空");
            }
            else
            {
                new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户登录", "用户名不存在");
            }
        }
    }
}


void MediaLogicAC::user_gearwheel_enrollsubmit(){
    QMap<QString, QList<QString>> userdatum_info = definfc.SuperQuery(DATABASE, "user_datum");
    user_template(userdatum_info, UserDataCore);
    QMap<NT::VERIFYTPE, bool> user_regid_verify;
    QMap<NT::VERIFYTPE, bool> user_regkey_verify;
    QMap<NT::VERIFYTPE, bool> user_regqkey_verify;
    QString registerName = UserDataCore.IP_ENROLL_ALIAS;
    user_regid_verify = user_data_verify(UserDataCore.IP_ENROLL_NAME);
    user_regkey_verify = user_data_verify(UserDataCore.IP_ENROLL_KEY);
    user_regqkey_verify = user_data_verify(UserDataCore.IP_ENROLL_QKEY);

    if (user_regid_verify[NT::VERIFY_OVERALL])
    {
        new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "请输入账户名");
    }

    else
    {
        if (user_regid_verify[NT::VERIFY_NUMBER])
        {
            new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "账户名为数字+字母组合");
        }

        else if (user_regid_verify[NT::VERIFY_LATTER])
        {
            new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "账户名为数字+字母组合");
        }

        else if (!user_regid_verify[NT::VERIFY_CHZCHAR])
        {
            new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "账户名不能包含中文字符");
        }
        else if (UserDataCore.USER_IDS.contains(UserDataCore.IP_ENROLL_NAME))
        {
            new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "账户名已存在");
        }

        else
        {
            if (user_regkey_verify[NT::VERIFY_OVERALL])
            {
                new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "请输入密码");
            }
            else
            {
                if (user_regkey_verify[NT::VERIFY_NUMBER])
                {
                    new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "密码为数字+字母+特殊字符组合");
                }
                else if (user_regkey_verify[NT::VERIFY_LATTER])
                {
                    new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "密码为数字+字母+特殊字符组合");
                }
                else if (user_regkey_verify[NT::VERIFY_SPECIAL])
                {
                    new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "密码为数字+字母+特殊字符组合");
                }
                else if (!user_regkey_verify[NT::VERIFY_CHZCHAR])
                {
                    new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "密码不能包含中文字符");
                }
                else
                {
                     if (user_regqkey_verify[NT::VERIFY_OVERALL])
                     {
                        new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "请再次输入密码");
                     }
                     else if (UserDataCore.IP_ENROLL_QKEY != UserDataCore.IP_ENROLL_KEY)
                     {
                        new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "确认密码输入错误，请重新输入");
                     }
                     else
                     {
                        if (user_regqkey_verify[NT::VERIFY_NUMBER])
                        {
                            new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "密码为数字+字母+特殊字符组合");
                        }
                        else if (user_regqkey_verify[NT::VERIFY_LATTER])
                        {
                            new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "密码为数字+字母+特殊字符组合");
                        }
                        else if (user_regqkey_verify[NT::VERIFY_SPECIAL])
                        {
                            new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "密码为数字+字母+特殊字符组合");
                        }
                        else if (!user_regqkey_verify[NT::VERIFY_CHZCHAR])
                        {
                            new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "密码不能包含中文字符");
                        }
                        else
                        {
                            if (UserDataCore.IP_ENROLL_ALIAS.isEmpty()) registerName = UserDataCore.IP_ENROLL_NAME;
                            if (Register_verifyinput->text().isEmpty())
                            {
                                new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "请输入验证码");
                            }
                            else
                            {
                                if (impact_str["VerificationCode"].toLower() == Register_verifyinput->text().simplified().toLower())
                                {
                                    QString AccRegisterSql = QString("INSERT INTO user_datum(ac_id, ac_name, ac_key) VALUES('%1', '%2', '%3')").arg(
                                                                     UserDataCore.IP_ENROLL_NAME,
                                                                     registerName,
                                                                     definfc.SuperConver(UserDataCore.IP_ENROLL_QKEY, cvType::cd_Ascii));
                                    if (Query->exec(AccRegisterSql))
                                    {
                                        Register_sumbit->setText("注册成功");
                                        connect(&USER_DLTXTC_QTIER, &QTimer::timeout, this, [&](){
                                                 Register_sumbit->setText("注册");
                                                 user_implantation_action(CAPBAREXTRA::UI_REGISTER);
                                        });
                                        USER_DLTXTC_QTIER.start();
                                    }
                                }
                                else
                                {
                                    new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户注册", "验证码输入错误");
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}


void MediaLogicAC::user_gearwheel_infoload(){
    QMap<QString, QList<QString>> userheads_info = definfc.SuperQuery(DATABASE, "user_heahs_datum", QString("ac_id = '%1'").arg(UserDataCore.USER_ID));
    QMap<QString, QList<QString>> userdatum_info = definfc.SuperQuery(DATABASE, "user_datum");
    user_template(userdatum_info, UserDataCore);
    user_template(userheads_info, UserDataCore, {"ac_id"});
    Datum_idLine->setText(UserDataCore.USER_ID);
    Datum_aliasEdit->setText(UserDataCore.USER_NAME);
    if (UserDataCore.USER_HEAD_PS.isEmpty())
    {
        impact_str["acadd-temporary-head"] = ":/PIXMAP/bench/captionbar-head.png";
        Datum_historyBox->g_stall()->addItem(":/PIXMAP/bench/captionbar-head.png");
        Datum_historyBox->g_linedit()->setText(impact_str["acadd-temporary-head"]);
        diary("accinfoload historyhead is empty, useing default header", Diary::Debug)
    }
    else
    {
        if (UserDataCore.USER_HEADP.isEmpty())
        {
            impact_str["acadd-temporary-head"] = ":/PIXMAP/bench/captionbar-head.png";
        }
        else
        {
            impact_str["acadd-temporary-head"] = UserDataCore.USER_HEADP;
        }
        Datum_historyBox->g_stall()->addItems(UserDataCore.USER_HEAD_PS);
        Datum_historyBox->g_linedit()->setText(impact_str["acadd-temporary-head"]);
        diary(QString("accinfoload historyhead loading, count: %1").arg(UserDataCore.USER_HEAD_PS.count()), Diary::Debug)
    }
    if (!UserDataCore.USER_HEAD_RC.isEmpty())
    {
        QRect coord = user_gearwheel_coordpaser(UserDataCore.USER_HEAD_RC).toRect();
        Datum_head->setCoord(coord);
    }
    USER_DLLD_QTIER.start();
}


void MediaLogicAC::user_gearwheel_infosubmit(){
    QMap<QString, QList<QString>> userdatum_info = definfc.SuperQuery(DATABASE, "user_datum");
    user_template(userdatum_info, UserDataCore);
    QStringList sqlinfo_writes;
    QStringList sqlhead_writes;
    if (impact_thread[ThreadPoint::MULTI_CROP] == NT::THREAD_IDLEABOUT)
    {
        if (!UserDataCore.IP_DATUM_KEY.isEmpty() && !UserDataCore.IP_DATUM_QKEY.isEmpty())
        {
            if (UserDataCore.IP_DATUM_KEY == UserDataCore.USER_KEY)
            {
                QMap<NT::VERIFYTPE, bool> user_datumqkey_verify = user_data_verify(UserDataCore.IP_DATUM_QKEY);
                if (!user_datumqkey_verify[NT::VERIFY_OVERALL] &&
                    !user_datumqkey_verify[NT::VERIFY_SPECIAL] &&
                    !user_datumqkey_verify[NT::VERIFY_NUMBER] &&
                    !user_datumqkey_verify[NT::VERIFY_LATTER] &&
                    user_datumqkey_verify[NT::VERIFY_CHZCHAR])
                {
                    if (!UserDataCore.IP_DATUM_KEY.isEmpty()) sqlinfo_writes.append(QString("ac_key='%1'").arg(definfc.SuperConver(UserDataCore.IP_DATUM_QKEY, cvType::cd_Ascii)));;
                }
                else
                {
                    new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户信息", "密码格式错误，请输入数字+字母+特殊字符密码");
                }
            }
            else
            {
                new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户信息", "原密码输入错误");
            }
        }

        else if (UserDataCore.IP_DATUM_KEY.isEmpty() && !UserDataCore.IP_DATUM_QKEY.isEmpty())
        {
            new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户信息", "请输入原密码");
        }

        else if (!UserDataCore.IP_DATUM_KEY.isEmpty() && UserDataCore.IP_DATUM_QKEY.isEmpty())
        {
            new MessageBoxQ(this, {"知道了"}, MessageBoxQ::MSG_Warning, "用户信息", "请输入新密码");
        }
        QString szc = definfc.isStrli(impact_stint["clipsize_send"]).join(' ');
        QString rcc = definfc.isStrli(impact_stint["clipping_send"]).join(' ');
        if (UserDataCore.USER_HEAD_PS.contains(impact_str["acadd-temporary-head"]))
        {
            sqlhead_writes.append(QString("head_clipsize='%1'").arg(szc));
            sqlhead_writes.append(QString("head_cliprect='%1'").arg(rcc));
            sqlhead_writes.append("apply=True");
            QString headupd_sqlchar = QString("UPDATE user_heahs_datum SET %1 WHERE ac_headp = '%2';").arg(sqlhead_writes.join(", "), impact_str["acadd-temporary-head"]);
            if (Query->exec(headupd_sqlchar))
            {
                headupd_sqlchar = QString("UPDATE user_heahs_datum SET apply=False WHERE ac_headp != '%1';").arg(impact_str["acadd-temporary-head"]);
                if (Query->exec(headupd_sqlchar))
                {
                    diary("auld data - heads update success", Diary::Debug)
                } else diary("auld data - heads update sql error: " + Query->lastError().text(), Diary::Error)
            } else diary("auld data - heads update sql error: " + Query->lastError().text(), Diary::Error)
        }
        else
        {
            QList<QString> keys({"ac_id", "ac_headp", "head_clipsize", "head_cliprect", "apply"});
            QList<QString> values({impact_str["ac-accept-name"], impact_str["acadd-temporary-head"], szc, rcc, QString::number(true)});
            QString headadd_sqlchar = QString("INSERT INTO user_heahs_datum%1 VALUES %2;").arg(definfc.c_tuple(keys), definfc.c_tuple(values));
            if (Query->exec(headadd_sqlchar))
            {
                diary("new data - heads insert success", Diary::Debug)
                QString headupd_sqlchar = QString("UPDATE user_heahs_datum SET apply=False WHERE ac_headp != '%1';").arg(impact_str["acadd-temporary-head"]);
                if (Query->exec(headupd_sqlchar))
                {
                    diary("new data - heads update success", Diary::Debug)
                }else diary("new data - heads update sql error: " + Query->lastError().text(), Diary::Error)
            } else diary("new data - insert into sql error: " + Query->lastError().text(), Diary::Error)
        }
        if (!UserDataCore.IP_DATUM_ALIAS.isEmpty()) sqlinfo_writes.append(QString("ac_name='%1'").arg(UserDataCore.IP_DATUM_ALIAS));
        QString datumupd_sqlchar = QString("UPDATE user_datum SET %1 WHERE might = True;").arg(sqlinfo_writes.join(", "));
        if (Query->exec(datumupd_sqlchar))
        {
            UserDataCore.IP_DATUM_ALIAS.isEmpty() ? captionBar()->d_caption(UserDataCore.IP_DATUM_NAME) :
                                                    captionBar()->d_caption(UserDataCore.IP_DATUM_ALIAS);
            BoilPool->run(ThreadPoint::MULTI_CROP);
            QMap<QString, QList<QString>> userhead_info = definfc.SuperQuery(DATABASE, "user_heahs_datum");
            user_template(userhead_info, UserDataCore);
            Datum_historyBox->g_stall()->clear();
            Datum_historyBox->g_stall()->addItems(UserDataCore.USER_HEAD_PS);
            Datum_historyBox->g_linedit()->setText(impact_str["acadd-temporary-head"]);
            diary("datum update success, multicrop running and hstrbox loader end", Diary::Debug)
        } else diary("datum update sql error: " + Query->lastError().text(), Diary::Error)
    }
}


QVariant MediaLogicAC::user_gearwheel_coordpaser(QString coordinfo){
    QList<int> paserli = definfc.isIntli(coordinfo.split(QRegularExpression("\\s+")));
    if (paserli.size() == 2)
    {
        return QSize(paserli[0], paserli[1]);
    }
    else if (paserli.size() == 4)
    {
        int x = paserli[0];
        int y = paserli[1];
        int w = paserli[2];
        int h = paserli[3];
        return QRect(x, y, w, h);
    }
    else
    {
        return false;
    }
}


QMap<NT::VERIFYTPE, bool> MediaLogicAC::user_data_verify(QString content){
    QMap<NT::VERIFYTPE, bool> verifyMap;
    QRegularExpression regexpNum("\\d");
    QRegularExpression regexpLetter("[a-zA-Z]");
    QRegularExpression regexpSpecial("\\W");
    QRegularExpression regexpChz("[\u4E00-\u9FA5]");
    bool _number = regexpNum.match(content).capturedTexts().isEmpty();
    bool _latter = regexpLetter.match(content).capturedTexts().isEmpty();
    bool _special = regexpSpecial.match(content).capturedTexts().isEmpty();
    bool _chzchar = regexpChz.match(content).capturedTexts().isEmpty();
    verifyMap.insert(NT::VERIFY_OVERALL, content.isEmpty());
    verifyMap.insert(NT::VERIFY_NUMBER, _number);
    verifyMap.insert(NT::VERIFY_LATTER, _latter);
    verifyMap.insert(NT::VERIFY_SPECIAL, _special);
    verifyMap.insert(NT::VERIFY_CHZCHAR, _chzchar);
    return verifyMap;
}


void MediaLogicAC::user_processing_imginfo(QString key, QList<qint64> cropInfo){
    impact_stint[key] = cropInfo;
}


void MediaLogicAC::user_head_update(QString curtain){
    captionBar()->d_captionico(curtain);
    Login_head->doconfigur_pixmap(curtain);
}


void MediaLogicAC::user_account_quit(bool isquit){
     QString AccQuitSql = QString("UPDATE user_datum SET final = True,"
                          "might = False "
                          "WHERE ac_id = '%1'").arg(UserDataCore.USER_ID);
    Query->exec(AccQuitSql);
    QString lastError = Query->lastError().text();
    if (lastError.simplified().isEmpty())
    {
        captionBar()->d_captionico(":/PIXMAP/bench/captionbar-head.png");
        captionBar()->d_caption("cst mdplr");
        Datum_idLine->clear();
        Datum_keyLine->clear();
        Datum_QkeyLine->clear();
        Datum_aliasEdit->clear();
        Login_idLibox->g_linedit()->clear();
        Login_keyLine->clear();
        Register_idLine->clear();
        Register_keyLine->clear();
        Register_QkeyLine->clear();
        Register_aliasLine->clear();
        Register_QkeyLine->clear();
        UserDataCore.release();
        impact_str["acadd-temporary-head"].clear();
        impact_swtc["user-accept-might"] = false;
        impact_str["ac-accept-name"].clear();
    }
    else
    {
        diary(lastError, Diary::Error);
    }
    if (isquit) close();
}


void MediaLogicAC::user_headtimer_hideload(){
    Datum_head->setPixmap(impact_str["acadd-temporary-head"]);
    diary("datum head delay load", Diary::Debug)
}

